<?php 
//提供返回按钮所需的参数
$backData = array('cooker' => 'BWCompanyInfo@ShowHome');
echo $control->renderView("header",array('backData' => $backData, 'title' => '涵信动态'));
?>
<!--******************** News Section ********************-->
<section id="news" class="single-page scrollblock">
  <div class="container">
    <!-- Three columns -->
    <div class="row">
        <?php 
        $i = 0; //用于判断输出row
        $reserve_arr=array_reverse($newsListArr);
        foreach ($reserve_arr as $newsList) {
            $newsId = $newsList->getId();
            $newsImage=$newsList->getItem('image')->getValue();
            $newsName = $newsList->getItem('name')->getValue();
            $newsDescription = $newsList->getItem('description')->getValue();
            $newsTime = $newsList->getItem('time')->getValue();
            $newsDescription = mb_substr(str_replace('&nbsp;', '', strip_tags($newsDescription)), 0, 80, 'utf-8');
            //生成ajax链接
            $ajaxScript =  $control->getAjaxScript('ShowArticle', array(
                'cooker' => 'BWCompanyInfoCooker@ShowArticle',
                'backCooker' => 'BWCompanyInfo@ShowTrendsList',
                'newsId' => $newsId,
                'htmlOptions' => array(
                    'class' => 'more-link'
            )));
            ?>
            <article class="span4 post" onclick="<?php echo $ajaxScript;?>"> <img class="img-news" src="<?php echo Yii::app()->request->baseurl. $newsImage;?>">
                <div class="inside">
                    <p class="post-date"><i class="icon-calendar"></i><?php echo $newsTime;?></p>
                    <h2><?php echo $newsName;?></h2>
                    <div class="entry-content">
                        <p><?php echo $newsDescription;?> ...</p>
                    </div>
                </div>
            </article>
        <?php
            $i++;
            if($i%3 == 0) {
                echo '</div>';
                echo '<div class="row">';
            }
        }
        ?>
    </div>
    <!-- /.row -->
  <!-- /.container -->
</section>
<?php 
echo $control->renderView("footer");
?>